<%--
  Created by IntelliJ IDEA.
  User: DCQ
  Date: 2025/3/7
  Time: 9:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" import="java.util.*"
         isELIgnored="false" %>
<%@ taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<rapid:override name="title">用户详情</rapid:override>

<rapid:override name="head_extend">
    <style>
        /* 响应式样式 */
        .user-detail-container {
            max-width: 1200px;
            margin: 20px auto;
            padding: 24px;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 12px rgba(0,0,0,0.1);
        }

        .detail-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            padding-bottom: 16px;
            border-bottom: 1px solid #eee;
        }

        .info-section {
            margin: 20px 0;
            padding: 16px;
            background: #f8f9fa;
            border-radius: 6px;
        }

        .section-title {
            color: #333;
            font-size: 16px;
            margin: 0 0 12px 0;
        }

        .info-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 16px;
        }

        .info-item {
            display: flex;
            align-items: center;
            min-height: 36px;
            padding: 8px 12px;
            background: white;
            border-radius: 4px;
            border: 1px solid #eee;
        }

        .info-item label {
            color: #666;
            min-width: 80px;
            margin-right: 12px;
        }

        /* 标签样式 */
        .tag-type, .tag-status, .tag-role {
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
        }

        .tag-type { background: #e6f7ff; color: #1890ff; }
        .tag-status.enabled { background: #f6ffed; color: #52c41a; }
        .tag-status.disabled { background: #fff2f0; color: #ff4d4f; }
        .tag-role { background: #fff7e6; color: #fa8c16; }

        /* 按钮样式 */
        .btn-back {
            padding: 8px 20px;
            background: #1890ff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .btn-change-pwd {
            margin-left: 12px;
            padding: 4px 8px;
            background: #13c2c2;
            color: white;
            border: none;
            border-radius: 3px;
            cursor: pointer;
        }

        /* 响应式适配 */
        @media (max-width: 768px) {
            .info-grid {
                grid-template-columns: 1fr;
            }

            .info-item {
                flex-direction: column;
                align-items: flex-start;
            }

            .info-item label {
                margin-bottom: 4px;
            }
        }
    </style>
</rapid:override>

<rapid:override name="content">

    <div class="user-detail-container">
        <!-- 标题栏 -->
        <div class="detail-header">
            <h2>用户详细信息</h2>
            <button class="btn-back" onclick="history.back()">返回列表</button>
        </div>

        <!-- 信息卡片 -->
        <div class="detail-card">
            <!-- 基本信息 -->
            <div class="info-section">
                <h3 class="section-title">基本信息</h3>
                <div class="info-grid">
                    <div class="info-item">
                        <label>用户ID：</label>
                        <span>${user.userId}</span>
                    </div>
                    <div class="info-item">
                        <label>用户账号：</label>
                        <span>${user.userName}</span>
                    </div>
                    <div class="info-item">
                        <label>用户姓名：</label>
                        <span></span>
                    </div>
                    <div class="info-item">
                        <label>性别：</label>
                        <span></span>
                    </div>
                    <div class="info-item">
                        <label>手机号码：</label>
<%--                        <span>${user.phone}</span>--%>
                    </div>
                    <div class="info-item">
                        <label>电子邮箱：</label>
                        <span>${user.email}</span>
                    </div>
                </div>
            </div>

            <!-- 账户信息 -->
            <div class="info-section">
                <h3 class="section-title">账户信息</h3>
                <div class="info-grid">
                    <div class="info-item">
                        <label>用户类型：</label>
                        <span class="tag-type">
                            <c:choose>
                                <c:when test="${user.userType.toString()=='Candidate'}">
                                    求职者
                                </c:when>
                                <c:when test="${user.userType.toString()=='Employee'}">
                                    在职员工
                                </c:when>
                                <c:otherwise>
                                    管理员
                                </c:otherwise>
                            </c:choose>
                        </span>
                    </div>
                    <div class="info-item">
                        <label>账户状态：</label>
                        <span class="tag-status">
                            <c:choose>
                                <c:when test="${user.isActive=='normal'}">
                                    启用
                                </c:when>
                                <c:when test="${user.isActive=='exception'}">
                                    异常
                                </c:when>
                                <c:otherwise>
                                    禁用
                                </c:otherwise>
                            </c:choose>


                        </span>
                    </div>
                    <div class="info-item">
                        <label>密码：</label>
                        <span>******</span>
                        <button class="btn-change-pwd" onclick="showChangePwdModal()">修改密码</button>
                    </div>
                </div>
            </div>

            <!-- 组织信息 -->
            <div class="info-section">
                <h3 class="section-title">组织信息</h3>
                <div class="info-grid">
                    <div class="info-item">
                        <label>所属部门：</label>
<%--                        <span>${user.deptName}</span>--%>
                    </div>
                    <div class="info-item">
                        <label>担任岗位：</label>
<%--                        <span>${user.postName}</span>--%>
                    </div>
                    <div class="info-item full-width">
                        <label>拥有角色：</label>
                        <div class="role-tags">
                            <%--<c:forEach items="${user.roles}" var="role">--%>
<%--                                <span class="tag-role">${role.roleName}</span>--%>
                            <%--</c:forEach>--%>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 时间信息 -->
            <div class="info-section">
                <h3 class="section-title">时间信息</h3>
                <div class="info-grid">
                    <div class="info-item">
                        <label>创建时间：</label>
                        <span><fmt:formatDate value="${user.createTime}" pattern="yyyy-MM-dd HH:mm"/></span>
                    </div>
                    <div class="info-item">
                        <label>最后登录：</label>
<%--                        <span><fmt:formatDate value="${user.lastLoginTime}" pattern="yyyy-MM-dd HH:mm"/></span>--%>
                    </div>
                </div>
            </div>
        </div>
    </div>

</rapid:override>

<rapid:override name="js_extend">
    <!-- Flot -->
    <script src="/static/css/plugins/flot/jquery.flot.js"></script>
    <script src="/static/css/plugins/flot/jquery.flot.tooltip.min.js"></script>
    <script src="/static/css/plugins/flot/jquery.flot.resize.js"></script>
    <script src="/static/css/plugins/flot/jquery.flot.pie.js"></script>
    <!-- 自定义js -->
    <script src="/static/css/content.js"></script>
    <!--flotdemo-->
</rapid:override>

<%@include file="/jsp/common/admin/base.jsp" %>

